package com.grao.waterschool.human.controller;

import com.grao.waterschool.human.common.PageResult;
import com.grao.waterschool.human.common.R;
import com.grao.waterschool.human.entiry.LogParam;
import com.grao.waterschool.human.entiry.po.LogOperation;
import com.grao.waterschool.human.manager.service.LogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author limk
 */
@RestController
@RequestMapping("/log")
@Tag(name = "日志相关接口", description = "日志相关接口")
public class LogController {

    private final LogService logService;

    @Autowired
    public LogController(LogService logService) {
        this.logService = logService;
    }

    @Operation(summary = "操作日志")
    @GetMapping("/operation/list")
    public R<PageResult<LogOperation>> operation(LogParam param) {
        PageResult<LogOperation> loggers = logService.selectLogOperationListPage(param);
        return R.success(loggers);
    }
}
